package com.service;

import com.mapper.jpa.PlayerRepository;
import com.model.jpa.Player;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PlayerService {

    @Autowired
    private PlayerRepository playerRepository;


    public Player save(Player player) {
        return playerRepository.save(player);
    }

    public List<Player> findAll() {
        return  playerRepository.findAll();
    }


    public Page<Player> findPage(Pageable pageable){
        return playerRepository.findAll(pageable);
    }
}
